<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\admin\model;

class Module extends \app\BaseModel
{
    protected $name = "longbing_module";
    protected $pk = "module_id";
    public function menu()
    {
        return $this->hasMany("menu", "module_id", "module_id");
    }
    public function moduleApp()
    {
        return $this->hasOne("moduleApp", "module_id", "module_id");
    }
    public function listModuleAll($filter, $uniacid = "7777")
    {
        $filter["deleted"] = 0;
        $result = $this->with(["moduleApp" => function ($query) {
            $query->where(["deleted" => 0, "uniacid" => $uniacid]);
        }])->where($filter)->select();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function getModule($filter, $uniacid = "7777")
    {
        $filter["deleted"] = 0;
        $result = $this->with(["moduleApp" => function ($query) {
            $query->where(["deleted" => 0, "uniacid" => $uniacid]);
        }])->where($filter)->find();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function listModule()
    {
    }
}

?>